<?php
/**
 * Created by PhpStorm.
 * User: cc
 * Date: 2023/7/6
 * Time: 10:45 AM
 */

namespace app\api\controller\v39;

use app\api\controller\v13\Auth2;
use app\common\cachemodel\AppConfig;

class Apple extends Auth2
{
    /**
     * @return \think\response\Json
     */
    public function goodsLink()
    {
        $appleGid = input('apple_gid/s', '');
        $appleGoodsLinkConfig = (new AppConfig())->configInfo('apple_goods_link');
        $data = isset($appleGoodsLinkConfig[$appleGid]) ? json_decode(htmlspecialchars_decode($appleGoodsLinkConfig[$appleGid]), true) : [];
        if (!$data)
        {
            $data = [
                'target' => '',
                'link' => ''
            ];
        }
        return show(config('code.success'), '获取成功', $data);
    }
}
